import Vue from 'vue'
import App from './App'
import router from './router'

// 支持less模块
// import less from 'less';
// Vue.use(less);

import("../static/css/font.css")
import("../static/css/global.css")

Vue.config.productionTip = false

router.beforeEach((to,from,next)=>{

  if((to.path.indexOf("/write") >=0 || to.path.indexOf("/profile") >=0) && !window.sessionStorage.getItem("userId")){
    next({name:"login"})
  }

  document.title = to.meta.title
  next()
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  render: h => h(App)
})


